﻿@model WeChatParking.Entity.Wx_user
@{
    ViewBag.Title = "个人中心";
    var list = ViewBag.list;
}

<div class="page page-personal" id="page-personal">
    <header class="bar bar-nav">
        <h1 class="title">个人中心</h1>
    </header>
    <div class="content">
        <div class="userinfo-bar">
            <div class="user-face">
                <img src="@Model.headimgurl" alt="用户头像" />
            </div>
            <div class="user-name">
                <p id="user-amount">@Model.nickname</p>
            </div>
            <div class="clear"></div>
        </div>
        <div class="list-block">
            <ul>
                @* <li>
                    <a href="Index" class="item-link item-content">
                        <div class="item-media">
                            <img src="~/Res/img/car.png" />
                        </div>
                        <div class="item-inner">
                            <div class="item-title">停车缴费</div>
                        </div>
                    </a>
                </li>*@
                <li>
                    <a href="#page-persona2" class="item-link item-content">
                        <div class="item-media">
                            <img src="~/Res/img/car2.png" />
                        </div>
                        <div class="item-inner">
                            <div class="item-title">我的车辆</div>
                        </div>
                    </a>
                </li>
                <li>
                    <a href="/H5/userCarRecord" class="item-link item-content">
                        <div class="item-media">
                            <img src="~/Res/img/账单.png" />
                        </div>
                        <div class="item-inner">
                            <div class="item-title">我的账单</div>
                            <div class="item-after"></div>
                        </div>
                    </a>
                </li>
                <li>
                    <a href="/H5/DaiJiao" class="item-link item-content">
                        <div class="item-media">
                            <img src="~/Res/img/付款.png" />
                        </div>
                        <div class="item-inner">
                            <div class="item-title">车辆代缴</div>
                            <div class="item-after"></div>
                        </div>
                    </a>
                </li>
            </ul>


        </div>
        <div class="copyright">
            <p>厦门一指通智能科技有限公司 </p>
            <p>©2018 www.xmyzt.com.cn</p>
        </div>
    </div>
</div>

<!-- 我的车辆 -->
<div class="page page-personal" id="page-persona2">
    <header class="bar bar-nav">
        <a class="button button-link button-nav pull-left back" data-transition='slide-out'>
            <span class="icon icon-left"></span>返回
        </a>
        <h1 class="title">我的车辆</h1>
    </header>
    <div class="content">

        <div class="list-block">
            <div class="content-block">

                @foreach (var item in list)
                {
                    <p><a class="button button-big" onclick="Relieve('@item.Car_plate')">@item.Car_plate </a></p>
                }

                @* <div class="col-100"><a href="AddCar/" class="button button-big button-fill button-danger">添加车辆</a></div>*@
                <div class="col-100"><a href="/h5/AddCar" class="button button-big button-fill button-danger">添加车辆</a></div>
            </div>
        </div>
        <div class="copyright">
            <p>厦门一指通智能科技有限公司 </p>
            <p>©2018 www.xmyzt.com.cn</p>
        </div>
    </div>
</div>
<script>
    function Relieve(val) {
        $.confirm('确认解除绑定 ' + val + ' 车牌？', function () {
            common.postAjax('/H5/RelieveCar', { ChePai: val }, function (result) {
                if (result.Code == 1) {
                    $.toast('解除绑定成功');
                    window.location.reload();
                } else {

                }
            });
        });
    }
    var common = {
        postAjax: function (url, data, success) {
            var hs = document.getElementsByName('__RequestVerificationToken');
            if (hs.length > 0) {
                data = data || {};
                data["__RequestVerificationToken"] = hs[0].value;
            }
            $.ajax({
                url: url,
                cache: false,
                type: 'post',
                dataType: 'json',
                data: data,
                success: success
            });
        }
    };
</script>
